  def display_cell x,y
         opts = []
         f={"underline"=>[:underline,"single"],"strike"=>[:strikethrough,"single"],"bold"=>[:weight,700],"italic"=>[:emphasis,"italic"]}
         f.each_key {|k|
           if z=x.is?(y,k) 
            if f[k][1].class==Fixnum
              opts << ":"+f[k][0].to_s+"=>"+f[k][1].to_s
            else
              opts << ":"+f[k][0].to_s+"=>'"+f[k][1]+"'"
            end
          end
         }
         x.get_format(y).each do |v|
           if v=~/([a-z]+)\:([a-z]+)/
             if $1=="back"
               @bg = $2
             elsif $1=="fore"
               @fg = $2
             end
           end
         end
         if @bg
           opts << ":fill=>'#{@bg}'"
         else
           opts << ":fill=>'white'"
         end
         if @fg
           opts << ":stroke=>'#{@fg}'"
         end 
         @bg=nil
         @fg = nil
         opts = "" if opts == [] 
         opts = ","+opts.join(',') unless opts == ""
         str =":text=>'#{x.get(y)}'#{opts},:border=>1,:family=>'courier'"
         return str
  end

  def cell_prop sheet,r,c,opts
    err = nil
    font = Wx::Font.new(10, Wx::MODERN, -1,-1, false)
    opts.each_key {|k|
      case k
        when :fill
          color = opts[k]
          sheet.set_cell_background_colour(r,c,Wx::Colour::new(color)) 
        when :stroke
          color = opts[k]
          sheet.set_cell_text_colour(r,c,Wx::Colour::new(color))
        when :emphasis
          font.set_style Wx::FONTSTYLE_ITALIC
        when :weight
          weight = opts[k]
          if weight > 400
            weight = Wx::FONTWEIGHT_BOLD
          else
            weight = Wx::FONTWEIGHT_NORMAL
          end
          font.set_weight weight
        when :underline
          font.set_underlined true
        when :strikethrough
         err = "#ERR: no striketrough" 
        when :text
          sheet.set_cell_value r,c,opts[k]
      end
      sheet.set_cell_font r,c,font
    }
    err
  end